import { createI18n } from 'vue-i18n'

import en from './en.json'
import zh from './zh.json'

const i18n = createI18n({
  legacy: false, // 使用 Composition API
  locale: localStorage.getItem('lang') || 'zh',
  fallbackLocale: 'zh',
  messages: {
    en,
    zh,
  },
})

export default i18n
